<template>
<div>
  <div class="my-counter" >
    <button type="button" class="btn btn-light" @click="newObj.goods_count>1? newObj.goods_count--:disabled" >-</button>
    <input type="number" @blur="countChange" class="form-control inp" v-model.number="newObj.goods_count">
    <button type="button" class="btn btn-light" @click="newObj.goods_count++">+</button>
  </div>
</div>
</template>

<script>

export default {
  name:'MyCount',
  props:{
    newObj:Object
  },
  methods:{
    countChange(){
      if(this.newObj.goods_count<1) this.newObj.goods_count=1
    }
  }
}
</script>

<style lang="less" scoped>
.my-counter {
  display: flex;
  .inp {
    width: 45px;
    text-align: center;
    margin: 0 10px;
  }
  .btn, .inp{
    transform: scale(0.9);
  }
}
</style>